export const SHOPIFY_CONFIG = {
  shopDomain: process.env.SHOPIFY_SHOP_DOMAIN || '',
  accessToken: process.env.SHOPIFY_ACCESS_TOKEN || ''
};

interface ShopifyConfig {
  shopDomain: string;
  accessToken: string;
}

export const verifyShopifyConnection = async (config: ShopifyConfig): Promise<boolean> => {
  try {
    const response = await fetch(`https://${config.shopDomain}/admin/api/2024-01/shop.json`, {
      headers: {
        'X-Shopify-Access-Token': config.accessToken,
      },
    });
    return response.ok;
  } catch (error) {
    console.error('Shopify connection verification failed:', error);
    return false;
  }
}; 